package uiml.android.elements.peers;

import java.util.ArrayList;

import org.w3c.dom.Element;

import uiml.android.elements.Logic;
import uiml.android.elements.UimlElementWithAttributes;

/**
 * 
 * @author bram
 *
 */
public class Peer extends UimlElementWithAttributes{

	// TODO comment
	ArrayList<Presentation> presentation = new ArrayList<Presentation>();
	ArrayList<Logic> logic = new ArrayList<Logic>();
	
	// TODO comment
	public static String IAM = "peers";
	
	/**
	 * 
	 * @param node
	 */
	public Peer(Element node){
		super(node);
		process();
	}

	/**
	 * 
	 */
	@Override
	protected Object clone() {
		// TODO Auto-generated method stub
		return null;
	}
	
	/**
	 * 
	 */
	@Override
	public void processElement(Element elem) {
		
		if(elem.getTagName().equals(Presentation.IAM))
			presentation.add(new Presentation(elem));
		else if(elem.getTagName().equals(Logic.IAM))
			logic.add(new Logic(elem));
		
	}

	/**
	 * 
	 * @return
	 */
	public ArrayList<Presentation> getPresentation() {
		return presentation;
	}

	/**
	 * 
	 * @param presentation
	 */
	public void setPresentation(ArrayList<Presentation> presentation) {
		this.presentation = presentation;
	}

	/**
	 * 
	 * @return
	 */
	public ArrayList<Logic> getLogic() {
		return logic;
	}

	/**
	 * 
	 * @param logic
	 */
	public void setLogic(ArrayList<Logic> logic) {
		this.logic = logic;
	}

}
